\chapter{Description of Android's application use cases}
\label{androidUseCasesDescription}

\textbf{To describe the use case diagrams, we use the template specified below:}
\begin{table}[ht]
\begin{tabular}{|p{\textwidth}|}
  \hline
  \rowcolor[gray]{0.9}\textbf{Name of the use case.} \\ \hline 
   All use cases have a name. \\ \hline
  \rowcolor[gray]{0.9}\textbf{Summary.}\\ \hline 
   A brief summary of the functionality. \\ \hline
  \rowcolor[gray]{0.9}\textbf{Dependency} \\ \hline 
   If the use case depends on another (or includes).\\ \hline
  \rowcolor[gray]{0.9}\textbf{Actors} \\ \hline 
   Names the actors who act in the use case.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Preconditions}\\ \hline 
   Conditions to be true at the beginning of the sequence of interactions that are defined in a use case\\ \hline
  \rowcolor[gray]{0.9}\textbf{Postconditions.}\\ \hline 
   Condition always true at the end of the main sequence.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Normal course} \\ \hline 
   Short story about the general sequence of the use case.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Alternatives courses.} \\ \hline 
   Description of the alternatives branches. \\ \hline
  \rowcolor[gray]{0.9}\textbf{Observations.} \\ \hline 
   Additional comments.\\\hline
\end{tabular}
\caption{Template use case description}
\label{template}
\end{table}

\clearpage
\textbf{Descrition of use cases for the Android application.}

\begin{table}[ht]
\begin{tabular}{|p{\textwidth}|}
  \hline
  \rowcolor[gray]{0.9}\textbf{Name of the use case.} \\ \hline 
  Login. \\ \hline
  \rowcolor[gray]{0.9}\textbf{Summary.}\\ \hline 
  The user logs in the system. \\ \hline
  \rowcolor[gray]{0.9}\textbf{Actors} \\ \hline 
  Mobile user.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Postconditions.}\\ \hline 
  The system identifies the user.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Normal course} \\ \hline 
  \begin{enumerate}
   \item The user enters his username and password.
   \item The system checks the username and password. 
   \item The system returns a positive or negative confirmation.
  \end{enumerate}\\ \hline
\end{tabular}
\caption{Login use case}
\label{loginUC}
\end{table}

\begin{table}[ht]
\begin{tabular}{|p{\textwidth}|}
  \hline
  \rowcolor[gray]{0.9}\textbf{Name of the use case.} \\ \hline 
  Register. \\ \hline
  \rowcolor[gray]{0.9}\textbf{Summary.}\\ \hline 
  A new user wants to use our system, he enters his personal data
  in the application and the system stores it. \\ \hline
  \rowcolor[gray]{0.9}\textbf{Actors} \\ \hline 
  Mobile user.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Postconditions.}\\ \hline 
  The user has been stored in the database and now he is able to login.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Normal course} \\ \hline 
  \begin{enumerate}
   \item The user enters all the data that the system requires.
   \item The system checks whether the user exists.
   \item The system returns a positive or negative confirmation.
  \end{enumerate}\\ \hline
  \rowcolor[gray]{0.9}\textbf{Alternatives courses.} \\ \hline 
  If the nick already exists, the user must choose other nick.
  \\\hline
\end{tabular}
\caption{Register use case}
\label{registerUC}
\end{table}

\begin{table}[ht]
\begin{tabular}{|p{\textwidth}|}
  \hline
  \rowcolor[gray]{0.9}\textbf{Name of the use case.} \\ \hline 
  View personal data. \\ \hline
  \rowcolor[gray]{0.9}\textbf{Summary.}\\ \hline 
  The user can view his personal data. \\ \hline
  \rowcolor[gray]{0.9}\textbf{Dependency} \\ \hline 
  The use case \emph{Modify personal data} extends this use case.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Actors} \\ \hline 
  Mobile user.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Preconditions}\\ \hline 
  The user must have logged in the system.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Normal course} \\ \hline 
  \begin{enumerate}
   \item The user selects the option to see his personal data.
   \item The system shows the personal data of the user.
   \item If the user wants to modify his personal data, starts the use case \emph{Modify personal data}
  \end{enumerate}\\ \hline
\end{tabular}
\caption{View personal data use case}
\label{seepersonaldataUC}
\end{table}

\begin{table}[ht]
\begin{tabular}{|p{\textwidth}|}
  \hline
  \rowcolor[gray]{0.9}\textbf{Name of the use case.} \\ \hline 
  Modify personal data\\ \hline
  \rowcolor[gray]{0.9}\textbf{Summary.}\\ \hline 
  The user modifies his personal data.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Dependency} \\ \hline 
  This use case extends the use case \emph{View personal data}.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Actors} \\ \hline 
  Mobile user.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Preconditions}\\ \hline 
  The user must have logged in the system.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Normal course} \\ \hline 
  \begin{enumerate}
   \item The user modifies his data.
   \item The system stores the changes.
  \end{enumerate}\\ \hline
\end{tabular}
\caption{Modify personal data use case}
\label{modifypersonaldataUC}
\end{table}

\begin{table}[ht]
\begin{tabular}{|p{\textwidth}|}
  \hline
  \rowcolor[gray]{0.9}\textbf{Name of the use case.} \\ \hline 
  View position.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Summary.}\\ \hline 
   The system displays the user's position on a map.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Dependency} \\ \hline 
   The use case \emph{View notes and photos} extends this use case.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Actors} \\ \hline 
  Mobile user.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Preconditions}\\ \hline 
  The user must have logged in the system.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Normal course} \\ \hline 
  \begin{enumerate}
   \item The system displays a map with the user's current position.
   \item If the user clicks in his position, starts the use case \emph{View notes and photos} with the user's photos and notes.
  \end{enumerate}
  \\ \hline
\end{tabular}
\caption{View position use case}
\label{seepositionUC}
\end{table}

\begin{table}[ht]
\begin{tabular}{|p{\textwidth}|}
  \hline
  \rowcolor[gray]{0.9}\textbf{Name of the use case.} \\ \hline 
   View friends position.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Summary.}\\ \hline 
   The system displays a map with the position of the user's friends.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Dependency} \\ \hline 
   The use case \emph{View notes and photos} extends this use case.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Actors} \\ \hline 
  Mobile user.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Preconditions}\\ \hline 
  The user must have logged in the system.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Normal course} \\ \hline 
  \begin{enumerate}
   \item The system displays a map showing the position of the user's friends.
   \item If the user click in his position, starts the use case \emph{View notes and photos} with the friend's photos and notes.
  \end{enumerate}\\ \hline
\end{tabular}
\caption{View friends position use case}
\label{plantilla}
\end{table}

\begin{table}[ht]
\begin{tabular}{|p{\textwidth}|}
  \hline
  \rowcolor[gray]{0.9}\textbf{Name of the use case.} \\ \hline 
  View notes and photos.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Summary.}\\ \hline 
   The user chooses a group of photos and photos and go to a gallery for viewing. \\ \hline
  \rowcolor[gray]{0.9}\textbf{Dependency} \\ \hline 
  This use case extends \emph{View position} and \emph{View friends position}.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Actors} \\ \hline 
  Mobile user.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Normal course} \\ \hline 
  \begin{enumerate}
  \item The system displays the photos and notes in the map grouped by proximity and the current zoom.
  \item The user chooses one of this groups.
  \item The system displays a gallery with the photos and notes of the selected group.
  \end{enumerate}\\ \hline
  \rowcolor[gray]{0.9}\textbf{Observations.} \\ \hline 
   This use case extends \emph{View position} and \emph{View friends position}. If the use case is called by \emph{View position}, 
   it displays the user notes and photos, otherwise if the use case is called by \emph{View friends position}, it displays
   the notes and photos of the selected user.\\\hline
\end{tabular}
\caption{View notes and photos use case}
\label{viewphotosnotesUC}
\end{table}

\begin{table}[ht]
\begin{tabular}{|p{\textwidth}|}
  \hline
  \rowcolor[gray]{0.9}\textbf{Name of the use case.} \\ \hline 
  Update position.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Summary.}\\ \hline 
   The system updates the user's position. \\ \hline
  \rowcolor[gray]{0.9}\textbf{Actors} \\ \hline 
  Mobile user.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Preconditions}\\ \hline 
  \begin{enumerate}
    \item The user must have logged in the system.
    \item The user must have internet connection.
  \end{enumerate}\\ \hline
  \rowcolor[gray]{0.9}\textbf{Normal course} \\ \hline 
  \begin{enumerate}
    \item The system updates the user's position when he moves more than 200 meters.
  \end{enumerate}\\ \hline
\end{tabular}
\caption{Update position use case}
\label{updatepositionUC}
\end{table}

\begin{table}[ht]
\begin{tabular}{|p{\textwidth}|}
  \hline
  \rowcolor[gray]{0.9}\textbf{Name of the use case.} \\ \hline 
  Create a note\\ \hline
  \rowcolor[gray]{0.9}\textbf{Summary.}\\ \hline 
  The user creates a note.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Actors} \\ \hline 
  Mobile user.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Preconditions}\\ \hline 
   The user must have logged in the system.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Postconditions.}\\ \hline 
  A new note has been stored in the database.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Normal course} \\ \hline 
  \begin{enumerate}
  \item The user writes a note.
  \item The system stores the note with the user's current position.
  \end{enumerate}\\ \hline
\end{tabular}
\caption{Create note use case}
\label{createnoteUC}
\end{table}

\begin{table}[ht]
\begin{tabular}{|p{\textwidth}|}
  \hline
  \rowcolor[gray]{0.9}\textbf{Name of the use case.} \\ \hline 
  Take a photo\\ \hline
  \rowcolor[gray]{0.9}\textbf{Summary.}\\ \hline 
  The user takes a photo.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Actors} \\ \hline 
  Mobile user.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Preconditions}\\ \hline 
   The user must have logged in the system.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Normal course} \\ \hline 
  \begin{enumerate}
  \item The user takes a photo.
  \item The user writes a note if he wants.
  \item The system stores the photo with the user's current position.
  \end{enumerate}\\ \hline
\end{tabular}
\caption{Take a photo use case}
\label{takephotoUC}
\end{table}

\begin{table}[ht]
\begin{tabular}{|p{\textwidth}|}
  \hline
  \rowcolor[gray]{0.9}\textbf{Name of the use case.} \\ \hline 
  Search a friend.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Summary.}\\ \hline 
  The user searches a user in the database by name, surname, country or nick.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Dependency} \\ \hline 
  The use case \emph{Request for friend} extends this use case.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Actors} \\ \hline 
  Mobile user.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Preconditions}\\ \hline 
  The user must have logged in the system.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Normal course} \\ \hline 
  \begin{enumerate}
  \item The user enters search tags.
  \item The system displays a list of the users found.
  \item The user selects a friend for the list and starts the use case \emph{Request for friend}.
  \end{enumerate}\\ \hline
  \rowcolor[gray]{0.9}\textbf{Alternatives courses.} \\ \hline 
   If the search does not find any results the use case finish.\\\hline
\end{tabular}
\caption{Search friend use case}
\label{searchfriendUC}
\end{table}

\begin{table}[ht]
\begin{tabular}{|p{\textwidth}|}
  \hline
  \rowcolor[gray]{0.9}\textbf{Name of the use case.} \\ \hline 
  Request for friend.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Summary.}\\ \hline 
  A user sends a request for friend to another user.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Dependency} \\ \hline 
  This use case extends \emph{Search a friend}.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Actors} \\ \hline 
  Mobile user.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Normal course} \\ \hline 
  \begin{enumerate}
  \item The user selects a friend for a list and the system sends a request for friend to the user.
  \end{enumerate}\\ \hline
\end{tabular}
\caption{Request for friend use case}
\label{requestforfriendUC}
\end{table}

\begin{table}[ht]
\begin{tabular}{|p{\textwidth}|}
  \hline
  \rowcolor[gray]{0.9}\textbf{Name of the use case.} \\ \hline 
  View friend requests.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Summary.}\\ \hline 
  The system displays a list of friend requests that the user has.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Dependency} \\ \hline 
  The uses cases \emph{Accept a friend} and \emph{Reject a friend} extends this use case.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Actors} \\ \hline 
  Mobile user.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Preconditions}\\ \hline 
  The user must have requested for friends.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Normal course} \\ \hline 
  \begin{enumerate}
  \item The system displays a list with the requests for friend that the user has.
  \item The user selects the users that he wants to be friend and starts the use case \emph{Accept a friend}.
  \item With the rest of users starts the use case \emph{Reject a friend}.
  \end{enumerate}\\ \hline
\end{tabular}
\caption{View friend requests use case}
\label{viewfriendrequestsUC}
\end{table}

\begin{table}[ht]
\begin{tabular}{|p{\textwidth}|}
  \hline
  \rowcolor[gray]{0.9}\textbf{Name of the use case.} \\ \hline 
  Accept a friend.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Summary.}\\ \hline 
  The user selects a user from a list and the system stores the friendship.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Dependency} \\ \hline 
  This use case extends \emph{View friend requests}.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Actors} \\ \hline 
  Mobile user.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Normal course} \\ \hline 
  \begin{enumerate}
  \item The user selects a user from a list and the system stores the friendship.
  \end{enumerate}\\ \hline
\end{tabular}
\caption{Accept a friend use case}
\label{acceptafriendUC}
\end{table}

\begin{table}[ht]
\begin{tabular}{|p{\textwidth}|}
  \hline
  \rowcolor[gray]{0.9}\textbf{Name of the use case.} \\ \hline 
  Reject a friend.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Summary.}\\ \hline 
  The system delete the request for friend.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Dependency} \\ \hline 
  This use case extends \emph{View friend requests}.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Actors} \\ \hline 
  Mobile user.\\ \hline
  \rowcolor[gray]{0.9}\textbf{Normal course} \\ \hline 
  \begin{enumerate}
  \item The system deletes all friend requests that the user does not want to have.
  \end{enumerate}\\ \hline
\end{tabular}
\caption{Reject a friend use case}
\label{rejectafriendUC}
\end{table}